home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Dialogs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  23.6 KB  |  718 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Dialogs.h
  3.  
  4.      Contains:    Dialog Manager interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8.1
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DIALOGS__
  19. #define __DIALOGS__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27. #ifndef __EVENTS__
  28. #include <Events.h>
  29. #endif
  30. #ifndef __MACWINDOWS__
  31. #include <MacWindows.h>
  32. #endif
  33. #ifndef __TEXTEDIT__
  34. #include <TextEdit.h>
  35. #endif
  36. #ifndef __CONTROLS__
  37. #include <Controls.h>
  38. #endif
  39.  
  40.  
  41.  
  42. #if PRAGMA_ONCE
  43. #pragma once
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if PRAGMA_IMPORT
  51. #pragma import on
  52. #endif
  53.  
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=mac68k
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61.  
  62.  
  63. enum {
  64.                                                                 /* new, more standard names for dialog item types*/
  65.     kControlDialogItem            = 4,
  66.     kButtonDialogItem            = kControlDialogItem | 0,
  67.     kCheckBoxDialogItem            = kControlDialogItem | 1,
  68.     kRadioButtonDialogItem        = kControlDialogItem | 2,
  69.     kResourceControlDialogItem    = kControlDialogItem | 3,
  70.     kStaticTextDialogItem        = 8,
  71.     kEditTextDialogItem            = 16,
  72.     kIconDialogItem                = 32,
  73.     kPictureDialogItem            = 64,
  74.     kUserDialogItem                = 0,
  75.     kItemDisableBit                = 128
  76. };
  77.  
  78.  
  79. enum {
  80.                                                                 /* old names for dialog item types*/
  81.     ctrlItem                    = 4,
  82.     btnCtrl                        = 0,
  83.     chkCtrl                        = 1,
  84.     radCtrl                        = 2,
  85.     resCtrl                        = 3,
  86.     statText                    = 8,
  87.     editText                    = 16,
  88.     iconItem                    = 32,
  89.     picItem                        = 64,
  90.     userItem                    = 0,
  91.     itemDisable                    = 128
  92. };
  93.  
  94.  
  95. enum {
  96.                                                                 /* standard dialog item numbers*/
  97.     kStdOkItemIndex                = 1,
  98.     kStdCancelItemIndex            = 2,                            /* old names*/
  99.     ok                            = kStdOkItemIndex,
  100.     cancel                        = kStdCancelItemIndex
  101. };
  102.  
  103.  
  104. enum {
  105.                                                                 /* standard icon resource id's     */
  106.     kStopIcon                    = 0,
  107.     kNoteIcon                    = 1,
  108.     kCautionIcon                = 2,                            /* old names*/
  109.     stopIcon                    = kStopIcon,
  110.     noteIcon                    = kNoteIcon,
  111.     cautionIcon                    = kCautionIcon
  112. };
  113.  
  114.  
  115.  
  116.  
  117. #if OLDROUTINENAMES
  118. /*
  119.    These constants lived briefly on ETO 16.  They suggest
  120.    that there is only one index you can use for the OK 
  121.    item, which is not true.  You can put the ok item 
  122.    anywhere you want in the DITL.
  123. */
  124.  
  125. enum {
  126.     kOkItemIndex                = 1,
  127.     kCancelItemIndex            = 2
  128. };
  129.  
  130. #endif  /* OLDROUTINENAMES */
  131.  
  132. /*    Dialog Item List Manipulation Constants    */
  133. typedef SInt16                             DITLMethod;
  134.  
  135. enum {
  136.     overlayDITL                    = 0,
  137.     appendDITLRight                = 1,
  138.     appendDITLBottom            = 2
  139. };
  140.  
  141. typedef SInt16                             StageList;
  142. /* DialogRef is obsolete. Use DialogPtr instead.*/
  143. typedef DialogPtr                         DialogRef;
  144.  
  145. struct DialogRecord {
  146.     WindowRecord                     window;
  147.     Handle                             items;
  148.     TEHandle                         textH;
  149.     SInt16                             editField;
  150.     SInt16                             editOpen;
  151.     SInt16                             aDefItem;
  152. };
  153. typedef struct DialogRecord                DialogRecord;
  154.  
  155. typedef DialogRecord *                    DialogPeek;
  156.  
  157. struct DialogTemplate {
  158.     Rect                             boundsRect;
  159.     SInt16                             procID;
  160.     Boolean                         visible;
  161.     Boolean                         filler1;
  162.     Boolean                         goAwayFlag;
  163.     Boolean                         filler2;
  164.     SInt32                             refCon;
  165.     SInt16                             itemsID;
  166.     Str255                             title;
  167. };
  168. typedef struct DialogTemplate            DialogTemplate;
  169.  
  170. typedef DialogTemplate *                DialogTPtr;
  171. typedef DialogTPtr *                    DialogTHndl;
  172.  
  173. struct AlertTemplate {
  174.     Rect                             boundsRect;
  175.     SInt16                             itemsID;
  176.     StageList                         stages;
  177. };
  178. typedef struct AlertTemplate            AlertTemplate;
  179.  
  180. typedef AlertTemplate *                    AlertTPtr;
  181. typedef AlertTPtr *                        AlertTHndl;
  182. /* new type abstractions for the dialog manager */
  183. typedef SInt16                             DialogItemIndexZeroBased;
  184. typedef SInt16                             DialogItemIndex;
  185. typedef SInt16                             DialogItemType;
  186. /* dialog manager callbacks */
  187. typedef CALLBACK_API( void , SoundProcPtr )(SInt16 soundNumber);
  188. typedef CALLBACK_API( Boolean , ModalFilterProcPtr )(DialogPtr theDialog, EventRecord *theEvent, DialogItemIndex *itemHit);
  189. typedef CALLBACK_API( void , UserItemProcPtr )(WindowPtr theWindow, DialogItemIndex itemNo);
  190. typedef STACK_UPP_TYPE(SoundProcPtr)                             SoundUPP;
  191. typedef STACK_UPP_TYPE(ModalFilterProcPtr)                         ModalFilterUPP;
  192. typedef STACK_UPP_TYPE(UserItemProcPtr)                         UserItemUPP;
  193. enum { uppSoundProcInfo = 0x00000080 };                         /* pascal no_return_value Func(2_bytes) */
  194. enum { uppModalFilterProcInfo = 0x00000FD0 };                     /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
  195. enum { uppUserItemProcInfo = 0x000002C0 };                         /* pascal no_return_value Func(4_bytes, 2_bytes) */
  196. #define NewSoundProc(userRoutine)                                 (SoundUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundProcInfo, GetCurrentArchitecture())
  197. #define NewModalFilterProc(userRoutine)                         (ModalFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppModalFilterProcInfo, GetCurrentArchitecture())
  198. #define NewUserItemProc(userRoutine)                             (UserItemUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserItemProcInfo, GetCurrentArchitecture())
  199. #define CallSoundProc(userRoutine, soundNumber)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppSoundProcInfo, (soundNumber))
  200. #define CallModalFilterProc(userRoutine, theDialog, theEvent, itemHit)  CALL_THREE_PARAMETER_UPP((userRoutine), uppModalFilterProcInfo, (theDialog), (theEvent), (itemHit))
  201. #define CallUserItemProc(userRoutine, theWindow, itemNo)         CALL_TWO_PARAMETER_UPP((userRoutine), uppUserItemProcInfo, (theWindow), (itemNo))
  202.  
  203. #if !TARGET_OS_MAC
  204. /* QuickTime 3.0 */
  205. typedef CALLBACK_API_C( void , QTModelessCallbackProcPtr )(EventRecord *theEvent, DialogPtr theDialog, DialogItemIndex itemHit);
  206. EXTERN_API( void )
  207. SetModelessDialogCallbackProc    (DialogPtr                 theDialog,
  208.                                  QTModelessCallbackProcPtr  callbackProc);
  209.  
  210. EXTERN_API( OSErr )
  211. GetDialogControlNotificationProc (void *                theProc);
  212.  
  213. EXTERN_API( void )
  214. SetDialogMovableModal            (DialogPtr                 theDialog);
  215.  
  216. EXTERN_API( void *)
  217. GetDialogParent                    (DialogPtr                 theDialog);
  218.  
  219. #endif  /*  !TARGET_OS_MAC */
  220.  
  221. /*
  222.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  223.       • Following types are valid with Appearance 1.0 and later
  224.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  225. */
  226.  
  227. enum {
  228.                                                                 /* Alert types to pass into StandardAlert */
  229.     kAlertStopAlert                = 0,
  230.     kAlertNoteAlert                = 1,
  231.     kAlertCautionAlert            = 2,
  232.     kAlertPlainAlert            = 3
  233. };
  234.  
  235. typedef SInt16                             AlertType;
  236.  
  237. enum {
  238.     kAlertDefaultOKText            = -1,                            /* "OK"*/
  239.     kAlertDefaultCancelText        = -1,                            /* "Cancel"*/
  240.     kAlertDefaultOtherText        = -1                            /* "Don't Save"*/
  241. };
  242.  
  243. /* StandardAlert alert button numbers */
  244.  
  245. enum {
  246.     kAlertStdAlertOKButton        = 1,
  247.     kAlertStdAlertCancelButton    = 2,
  248.     kAlertStdAlertOtherButton    = 3,
  249.     kAlertStdAlertHelpButton    = 4
  250. };
  251.  
  252.  
  253. enum {
  254.                                                                 /* Dialog Flags for use in NewFeaturesDialog or dlgx resource */
  255.     kDialogFlagsUseThemeBackground = (1 << 0),
  256.     kDialogFlagsUseControlHierarchy = (1 << 1),
  257.     kDialogFlagsHandleMovableModal = (1 << 2),
  258.     kDialogFlagsUseThemeControls = (1 << 3)
  259. };
  260.  
  261.  
  262. enum {
  263.                                                                 /* Alert Flags for use in alrx resource */
  264.     kAlertFlagsUseThemeBackground = (1 << 0),
  265.     kAlertFlagsUseControlHierarchy = (1 << 1),
  266.     kAlertFlagsAlertIsMovable    = (1 << 2),
  267.     kAlertFlagsUseThemeControls    = (1 << 3)
  268. };
  269.  
  270. /* For dftb resource */
  271.  
  272. enum {
  273.     kDialogFontNoFontStyle        = 0,
  274.     kDialogFontUseFontMask        = 0x0001,
  275.     kDialogFontUseFaceMask        = 0x0002,
  276.     kDialogFontUseSizeMask        = 0x0004,
  277.     kDialogFontUseForeColorMask    = 0x0008,
  278.     kDialogFontUseBackColorMask    = 0x0010,
  279.     kDialogFontUseModeMask        = 0x0020,
  280.     kDialogFontUseJustMask        = 0x0040,
  281.     kDialogFontUseAllMask        = 0x00FF,
  282.     kDialogFontAddFontSizeMask    = 0x0100,
  283.     kDialogFontUseFontNameMask    = 0x0200
  284. };
  285.  
  286.  
  287. struct AlertStdAlertParamRec {
  288.     Boolean                         movable;                    /* Make alert movable modal */
  289.     Boolean                         helpButton;                    /* Is there a help button? */
  290.     ModalFilterUPP                     filterProc;                    /* Event filter */
  291.     StringPtr                         defaultText;                /* Text for button in OK position */
  292.     StringPtr                         cancelText;                    /* Text for button in cancel position */
  293.     StringPtr                         otherText;                    /* Text for button in left position */
  294.     SInt16                             defaultButton;                /* Which button behaves as the default */
  295.     SInt16                             cancelButton;                /* Which one behaves as cancel (can be 0) */
  296.     UInt16                             position;                    /* Position (kWindowDefaultPosition in this case */
  297.                                                                 /* equals kWindowAlertPositionParentWindowScreen) */
  298. };
  299. typedef struct AlertStdAlertParamRec    AlertStdAlertParamRec;
  300.  
  301. typedef AlertStdAlertParamRec *            AlertStdAlertParamPtr;
  302. /* ——— end Appearance 1.0 or later stuff*/
  303.  
  304.  
  305.  
  306.  
  307.  
  308. /*
  309.     NOTE: Code running under MultiFinder or System 7.0 or newer
  310.     should always pass NULL to InitDialogs.
  311. */
  312. EXTERN_API( void )
  313. InitDialogs                        (void *                    ignored)                            ONEWORDINLINE(0xA97B);
  314.  
  315. EXTERN_API( void )
  316. ErrorSound                        (SoundUPP                 soundProc)                            ONEWORDINLINE(0xA98C);
  317.  
  318. EXTERN_API( DialogPtr )
  319. NewDialog                        (void *                    dStorage,
  320.                                  const Rect *            boundsRect,
  321.                                  ConstStr255Param         title,
  322.                                  Boolean                 visible,
  323.                                  SInt16                 procID,
  324.                                  WindowPtr                 behind,
  325.                                  Boolean                 goAwayFlag,
  326.                                  SInt32                 refCon,
  327.                                  Handle                 items)                                ONEWORDINLINE(0xA97D);
  328.  
  329. EXTERN_API( DialogPtr )
  330. GetNewDialog                    (SInt16                 dialogID,
  331.                                  void *                    dStorage,
  332.                                  WindowPtr                 behind)                                ONEWORDINLINE(0xA97C);
  333.  
  334. EXTERN_API( DialogPtr )
  335. NewColorDialog                    (void *                    dStorage,
  336.                                  const Rect *            boundsRect,
  337.                                  ConstStr255Param         title,
  338.                                  Boolean                 visible,
  339.                                  SInt16                 procID,
  340.                                  WindowPtr                 behind,
  341.                                  Boolean                 goAwayFlag,
  342.                                  SInt32                 refCon,
  343.                                  Handle                 items)                                ONEWORDINLINE(0xAA4B);
  344.  
  345. EXTERN_API( void )
  346. CloseDialog                        (DialogPtr                 theDialog)                            ONEWORDINLINE(0xA982);
  347.  
  348. EXTERN_API( void )
  349. DisposeDialog                    (DialogPtr                 theDialog)                            ONEWORDINLINE(0xA983);
  350.  
  351. EXTERN_API( void )
  352. ModalDialog                        (ModalFilterUPP         modalFilter,
  353.                                  DialogItemIndex *        itemHit)                            ONEWORDINLINE(0xA991);
  354.  
  355. EXTERN_API( Boolean )
  356. IsDialogEvent                    (const EventRecord *    theEvent)                            ONEWORDINLINE(0xA97F);
  357.  
  358. EXTERN_API( Boolean )
  359. DialogSelect                    (const EventRecord *    theEvent,
  360.                                  DialogPtr *            theDialog,
  361.                                  DialogItemIndex *        itemHit)                            ONEWORDINLINE(0xA980);
  362.  
  363. EXTERN_API( void )
  364. DrawDialog                        (DialogPtr                 theDialog)                            ONEWORDINLINE(0xA981);
  365.  
  366. EXTERN_API( void )
  367. UpdateDialog                    (DialogPtr                 theDialog,
  368.                                  RgnHandle                 updateRgn)                            ONEWORDINLINE(0xA978);
  369.  
  370. EXTERN_API( void )
  371. HideDialogItem                    (DialogPtr                 theDialog,
  372.                                  DialogItemIndex         itemNo)                                ONEWORDINLINE(0xA827);
  373.  
  374. EXTERN_API( void )
  375. ShowDialogItem                    (DialogPtr                 theDialog,
  376.                                  DialogItemIndex         itemNo)                                ONEWORDINLINE(0xA828);
  377.  
  378. EXTERN_API( DialogItemIndexZeroBased )
  379. FindDialogItem                    (DialogPtr                 theDialog,
  380.                                  Point                     thePt)                                ONEWORDINLINE(0xA984);
  381.  
  382. EXTERN_API( void )
  383. DialogCut                        (DialogPtr                 theDialog);
  384.  
  385. EXTERN_API( void )
  386. DialogPaste                        (DialogPtr                 theDialog);
  387.  
  388. EXTERN_API( void )
  389. DialogCopy                        (DialogPtr                 theDialog);
  390.  
  391. EXTERN_API( void )
  392. DialogDelete                    (DialogPtr                 theDialog);
  393.  
  394. EXTERN_API( DialogItemIndex )
  395. Alert                            (SInt16                 alertID,
  396.                                  ModalFilterUPP         modalFilter)                        ONEWORDINLINE(0xA985);
  397.  
  398. EXTERN_API( DialogItemIndex )
  399. StopAlert                        (SInt16                 alertID,
  400.                                  ModalFilterUPP         modalFilter)                        ONEWORDINLINE(0xA986);
  401.  
  402. EXTERN_API( DialogItemIndex )
  403. NoteAlert                        (SInt16                 alertID,
  404.                                  ModalFilterUPP         modalFilter)                        ONEWORDINLINE(0xA987);
  405.  
  406. EXTERN_API( DialogItemIndex )
  407. CautionAlert                    (SInt16                 alertID,
  408.                                  ModalFilterUPP         modalFilter)                        ONEWORDINLINE(0xA988);
  409.  
  410. EXTERN_API( void )
  411. GetDialogItem                    (DialogPtr                 theDialog,
  412.                                  DialogItemIndex         itemNo,
  413.                                  DialogItemType *        itemType,
  414.                                  Handle *                item,
  415.                                  Rect *                    box)                                ONEWORDINLINE(0xA98D);
  416.  
  417. EXTERN_API( void )
  418. SetDialogItem                    (DialogPtr                 theDialog,
  419.                                  DialogItemIndex         itemNo,
  420.                                  DialogItemType         itemType,
  421.                                  Handle                 item,
  422.                                  const Rect *            box)                                ONEWORDINLINE(0xA98E);
  423.  
  424. EXTERN_API( void )
  425. ParamText                        (ConstStr255Param         param0,
  426.                                  ConstStr255Param         param1,
  427.                                  ConstStr255Param         param2,
  428.                                  ConstStr255Param         param3)                                ONEWORDINLINE(0xA98B);
  429.  
  430. EXTERN_API( void )
  431. SelectDialogItemText            (DialogPtr                 theDialog,
  432.                                  DialogItemIndex         itemNo,
  433.                                  SInt16                 strtSel,
  434.                                  SInt16                 endSel)                                ONEWORDINLINE(0xA97E);
  435.  
  436. EXTERN_API( void )
  437. GetDialogItemText                (Handle                 item,
  438.                                  Str255                 text)                                ONEWORDINLINE(0xA990);
  439.  
  440. EXTERN_API( void )
  441. SetDialogItemText                (Handle                 item,
  442.                                  ConstStr255Param         text)                                ONEWORDINLINE(0xA98F);
  443.  
  444. EXTERN_API( SInt16 )
  445. GetAlertStage                    (void)                                                        TWOWORDINLINE(0x3EB8, 0x0A9A);
  446.  
  447. EXTERN_API( void )
  448. SetDialogFont                    (SInt16                 value)                                TWOWORDINLINE(0x31DF, 0x0AFA);
  449.  
  450. EXTERN_API( void )
  451. ResetAlertStage                    (void)                                                        TWOWORDINLINE(0x4278, 0x0A9A);
  452.  
  453.  
  454. #if CGLUESUPPORTED
  455. EXTERN_API_C( DialogPtr )
  456. newdialog                        (void *                    dStorage,
  457.                                  const Rect *            boundsRect,
  458.                                  const char *            title,
  459.                                  Boolean                 visible,
  460.                                  SInt16                 procID,
  461.                                  WindowPtr                 behind,
  462.                                  Boolean                 goAwayFlag,
  463.                                  SInt32                 refCon,
  464.                                  Handle                 items);
  465.  
  466. EXTERN_API_C( DialogPtr )
  467. newcolordialog                    (void *                    dStorage,
  468.                                  const Rect *            boundsRect,
  469.                                  const char *            title,
  470.                                  Boolean                 visible,
  471.                                  SInt16                 procID,
  472.                                  WindowPtr                 behind,
  473.                                  Boolean                 goAwayFlag,
  474.                                  SInt32                 refCon,
  475.                                  Handle                 items);
  476.  
  477. EXTERN_API_C( void )
  478. paramtext                        (const char *            param0,
  479.                                  const char *            param1,
  480.                                  const char *            param2,
  481.                                  const char *            param3);
  482.  
  483. EXTERN_API_C( void )
  484. getdialogitemtext                (Handle                 item,
  485.                                  char *                    text);
  486.  
  487. EXTERN_API_C( void )
  488. setdialogitemtext                (Handle                 item,
  489.                                  const char *            text);
  490.  
  491. EXTERN_API_C( DialogItemIndexZeroBased )
  492. finddialogitem                    (DialogPtr                 theDialog,
  493.                                  Point *                thePt);
  494.  
  495. #endif  /* CGLUESUPPORTED */
  496.  
  497. EXTERN_API( void )
  498. AppendDITL                        (DialogPtr                 theDialog,
  499.                                  Handle                 theHandle,
  500.                                  DITLMethod             method);
  501.  
  502. EXTERN_API( DialogItemIndex )
  503. CountDITL                        (DialogPtr                 theDialog);
  504.  
  505. EXTERN_API( void )
  506. ShortenDITL                        (DialogPtr                 theDialog,
  507.                                  DialogItemIndex         numberItems);
  508.  
  509. EXTERN_API( Boolean )
  510. StdFilterProc                    (DialogPtr                 theDialog,
  511.                                  EventRecord *            event,
  512.                                  DialogItemIndex *        itemHit);
  513.  
  514. EXTERN_API( OSErr )
  515. GetStdFilterProc                (ModalFilterUPP *        theProc)                            THREEWORDINLINE(0x303C, 0x0203, 0xAA68);
  516.  
  517. EXTERN_API( OSErr )
  518. SetDialogDefaultItem            (DialogPtr                 theDialog,
  519.                                  DialogItemIndex         newItem)                            THREEWORDINLINE(0x303C, 0x0304, 0xAA68);
  520.  
  521. EXTERN_API( OSErr )
  522. SetDialogCancelItem                (DialogPtr                 theDialog,
  523.                                  DialogItemIndex         newItem)                            THREEWORDINLINE(0x303C, 0x0305, 0xAA68);
  524.  
  525. EXTERN_API( OSErr )
  526. SetDialogTracksCursor            (DialogPtr                 theDialog,
  527.                                  Boolean                 tracks)                                THREEWORDINLINE(0x303C, 0x0306, 0xAA68);
  528.  
  529.  
  530.  
  531. /*
  532.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  533.       • Appearance Dialog Routines (available only with Appearance 1.0 and later)
  534.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  535. */
  536.  
  537. EXTERN_API( DialogPtr )
  538. NewFeaturesDialog                (void *                    inStorage,
  539.                                  const Rect *            inBoundsRect,
  540.                                  ConstStr255Param         inTitle,
  541.                                  Boolean                 inIsVisible,
  542.                                  SInt16                 inProcID,
  543.                                  WindowPtr                 inBehind,
  544.                                  Boolean                 inGoAwayFlag,
  545.                                  SInt32                 inRefCon,
  546.                                  Handle                 inItemListHandle,
  547.                                  UInt32                 inFlags)                            THREEWORDINLINE(0x303C, 0x110C, 0xAA68);
  548.  
  549. EXTERN_API( OSErr )
  550. AutoSizeDialog                    (DialogPtr                 inDialog)                            THREEWORDINLINE(0x303C, 0x020D, 0xAA68);
  551.  
  552. EXTERN_API( OSErr )
  553. StandardAlert                    (AlertType                 inAlertType,
  554.                                  StringPtr                 inError,
  555.                                  StringPtr                 inExplanation,
  556.                                  AlertStdAlertParamPtr     inAlertParam,
  557.                                  SInt16 *                outItemHit)                            THREEWORDINLINE(0x303C, 0x090E, 0xAA68);
  558.  
  559. EXTERN_API( OSErr )
  560. GetDialogItemAsControl            (DialogPtr                 inDialog,
  561.                                  SInt16                 inItemNo,
  562.                                  ControlHandle *        outControl)                            THREEWORDINLINE(0x303C, 0x050F, 0xAA68);
  563.  
  564. EXTERN_API( OSErr )
  565. MoveDialogItem                    (DialogPtr                 inDialog,
  566.                                  SInt16                 inItemNo,
  567.                                  SInt16                 inHoriz,
  568.                                  SInt16                 inVert)                                THREEWORDINLINE(0x303C, 0x0510, 0xAA68);
  569.  
  570. EXTERN_API( OSErr )
  571. SizeDialogItem                    (DialogPtr                 inDialog,
  572.                                  SInt16                 inItemNo,
  573.                                  SInt16                 inWidth,
  574.                                  SInt16                 inHeight)                            THREEWORDINLINE(0x303C, 0x0511, 0xAA68);
  575.  
  576. #if OLDROUTINENAMES
  577. #define DisposDialog(theDialog) DisposeDialog(theDialog)
  578. #define UpdtDialog(theDialog, updateRgn) UpdateDialog(theDialog, updateRgn)
  579. #define GetDItem(theDialog, itemNo, itemType, item, box) GetDialogItem(theDialog, itemNo, itemType, item, box)
  580. #define SetDItem(theDialog, itemNo, itemType, item, box) SetDialogItem(theDialog, itemNo, itemType, item, box)
  581. #define HideDItem(theDialog, itemNo) HideDialogItem(theDialog, itemNo)
  582. #define ShowDItem(theDialog, itemNo) ShowDialogItem(theDialog, itemNo)
  583. #define SelIText(theDialog, itemNo, strtSel, endSel) SelectDialogItemText(theDialog, itemNo, strtSel, endSel)
  584. #define GetIText(item, text) GetDialogItemText(item, text)
  585. #define SetIText(item, text) SetDialogItemText(item, text)
  586. #define FindDItem(theDialog, thePt) FindDialogItem(theDialog, thePt)
  587. #define NewCDialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items) \
  588. NewColorDialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items)
  589. #define GetAlrtStage() GetAlertStage()
  590. #define ResetAlrtStage() ResetAlertStage()
  591. #define DlgCut(theDialog) DialogCut(theDialog)
  592. #define DlgPaste(theDialog) DialogPaste(theDialog)
  593. #define DlgCopy(theDialog) DialogCopy(theDialog)
  594. #define DlgDelete(theDialog) DialogDelete(theDialog)
  595. #define SetDAFont(fontNum) SetDialogFont(fontNum)
  596. #if CGLUESUPPORTED
  597. #define newcdialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items) \
  598. newcolordialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items)
  599. #define getitext(item, text) getdialogitemtext(item, text)
  600. #define setitext(item, text) setdialogitemtext(item, text)
  601. #define findditem(theDialog, thePt) finddialogitem(theDialog, thePt)
  602. #endif  /* CGLUESUPPORTED */
  603.  
  604. #endif  /* OLDROUTINENAMES */
  605.  
  606. /*
  607.     *****************************************************************************
  608.     *                                                                           *
  609.     * The conditional STRICT_DIALOGS has been removed from this interface file. *
  610.     * The accessor macros to a DialogRecord are no longer necessary.            *
  611.     *                                                                           *
  612.     * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  613.     *                                                                           *
  614.     *****************************************************************************
  615.  
  616.     Details:
  617.     The original purpose of the STRICT_ conditionals and accessor macros was to
  618.     help ease the transition to Copland.  Shared data structures are difficult
  619.     to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  620.     WindowRecord and other data structures, we would begin the migration to the
  621.     discipline wherein system data structures are completely hidden from
  622.     applications.
  623.     
  624.     After many design reviews, we finally concluded that with this sort of
  625.     migration, the system could never tell when an application was no longer
  626.     peeking at a WindowRecord, and thus the data structure might never become
  627.     system owned.  Additionally, there were many other limitations in the
  628.     classic toolbox that were begging to be addressed.  The final decision was
  629.     to leave the traditional toolbox as a compatibility mode.
  630.     
  631.     We also decided to use the Handle and Ptr based types in the function
  632.     declarations.  For example, NewWindow now returns a WindowPtr rather than a
  633.     WindowRef.  The Ref types are still defined in the header files, so all
  634.     existing code will still compile exactly as it did before.  There are
  635.     several reasons why we chose to do this:
  636.     
  637.     - The importance of backwards compatibility makes it unfeasible for us to
  638.     enforce real opaque references in the implementation anytime in the
  639.     foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  640.     ControlRef, etc.) in the documentation and header files would always be a
  641.     fake veneer of opacity.
  642.     
  643.     - There exists a significant base of books and sample code that neophyte
  644.     Macintosh developers use to learn how to program the Macintosh.  These
  645.     books and sample code all use direct data access.  Introducing opaque data
  646.     types at this point would confuse neophyte programmers more than it would
  647.     help them.
  648.     
  649.     - Direct data structure access is used by nearly all Macintosh developers. 
  650.     Changing the interfaces to reflect a false opacity would not provide any
  651.     benefit to these developers.
  652.     
  653.     - Accessor functions are useful in and of themselves as convenience
  654.     functions, without being tied to opaque data types.  We will complete and
  655.     document the Windows and Dialogs accessor functions in an upcoming release
  656.     of the interfaces.
  657. */
  658. #ifdef __cplusplus
  659. inline WindowPtr     GetDialogWindow(DialogPtr dialog)        { return (WindowPtr) dialog;                         }
  660. inline SInt16        GetDialogDefaultItem(DialogPtr dialog)  { return (*(SInt16 *) (((UInt8 *) dialog) + 168));    }
  661. inline SInt16        GetDialogCancelItem(DialogPtr dialog)     { return (*(SInt16 *) (((UInt8 *) dialog) + 166));    }
  662. inline SInt16        GetDialogKeyboardFocusItem(DialogPtr dialog)    { return ((*(SInt16 *) (((UInt8 *) dialog) + 164)) < 0 ? -1 : (*(SInt16 *) (((UInt8 *) dialog) + 164)) + 1); }
  663. inline void        SetGrafPortOfDialog(DialogPtr dialog) { MacSetPort ((GrafPtr) dialog); }
  664. #else
  665. #define GetDialogWindow(dialog)    ((WindowPtr) dialog)
  666. #define GetDialogDefaultItem(dialog) (*(SInt16 *) (((UInt8 *) dialog) + 168))
  667. #define GetDialogCancelItem(dialog) (*(SInt16 *) (((UInt8 *) dialog) + 166))
  668. #define GetDialogKeyboardFocusItem(dialog) ((*(SInt16 *) (((UInt8 *) dialog) + 164)) < 0 ? -1 : (*(SInt16 *) (((UInt8 *) dialog) + 164)) + 1)
  669. #define SetGrafPortOfDialog(dialog) do { MacSetPort ((GrafPtr) dialog); } while (false)
  670. #endif
  671.  
  672.  
  673.  
  674. EXTERN_API( void )
  675. CouldDialog                        (SInt16                 dialogID)                            ONEWORDINLINE(0xA979);
  676.  
  677. EXTERN_API( void )
  678. FreeDialog                        (SInt16                 dialogID)                            ONEWORDINLINE(0xA97A);
  679.  
  680. EXTERN_API( void )
  681. CouldAlert                        (SInt16                 alertID)                            ONEWORDINLINE(0xA989);
  682.  
  683. EXTERN_API( void )
  684. FreeAlert                        (SInt16                 alertID)                            ONEWORDINLINE(0xA98A);
  685.  
  686.  
  687.  
  688.  
  689.  
  690. #if !TARGET_OS_MAC
  691. #endif  /*  !TARGET_OS_MAC */
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698. #if PRAGMA_STRUCT_ALIGN
  699.     #pragma options align=reset
  700. #elif PRAGMA_STRUCT_PACKPUSH
  701.     #pragma pack(pop)
  702. #elif PRAGMA_STRUCT_PACK
  703.     #pragma pack()
  704. #endif
  705.  
  706. #ifdef PRAGMA_IMPORT_OFF
  707. #pragma import off
  708. #elif PRAGMA_IMPORT
  709. #pragma import reset
  710. #endif
  711.  
  712. #ifdef __cplusplus
  713. }
  714. #endif
  715.  
  716. #endif /* __DIALOGS__ */
  717.  
  718.